package com.dhcc.bpm.modules.gateway.mapper;

import com.dhcc.bpm.modules.gateway.entity.GatewayRoute;
import com.dhcc.bpm.modules.gateway.vo.GatewayRouteVO;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @ClassName GatewayRouteMapper
 * @Description 网关表 Mapper 接口
 * @Author YaoZC
 * @Date 2019/11/26 16:08
 * @Version 1.0
 * @Copyright: 2019 东华软件 . All rights reserved.
 */
public interface GatewayRouteMapper extends BaseMapper<GatewayRoute> {

	/**
	 * @Description 自定义分页
	 * @Date 2019/11/26 16:08
	 * @param page
	 * @param gatewayRoute
	 * @return com.baomidou.mybatisplus.core.metadata.IPage<com.dhcc.bpm.modules.gateway.vo.GatewayRouteVO>
	 **/
	List<GatewayRouteVO> selectGatewayRoutePage(IPage page, GatewayRouteVO gatewayRoute);
	/**
	 * @Description 根据网关id获取网关路由信息
	 * @Date 2019/11/26 16:08
	 * @param id
	 * @return java.util.List<com.dhcc.bpm.modules.gateway.vo.GatewayRouteVO>
	 **/
	/**
	 * @Description 根据基础产品查路由列表和根据api查路由列表
	 * @Date 2020/12/01 16:08
	 * @param page
	 * @param gatewayRoute
	 * @return com.baomidou.mybatisplus.core.metadata.IPage<com.dhcc.bpm.modules.gateway.vo.GatewayRouteVO>
	 **/
	List<GatewayRouteVO> listGatewayRoute(IPage page, @Param("gatewayRoute") GatewayRouteVO gatewayRoute);

    List<GatewayRouteVO> selectByGatewayId(Long id);

	/**
	 * @Description 根据网关id获取网关路由信息
	 * @Date 2019/11/26 16:08
	 * @param apiId
	 * @return java.util.List<com.dhcc.bpm.modules.gateway.vo.GatewayRouteVO>
	 **/
	List<GatewayRouteVO> getByApiId(String apiId);

	/**
	 * @Description 根据后端服务id获取网关路由信息
	 * @Date 2019/11/26 16:08
	 * @param backServiceId
	 * @return java.util.List<com.dhcc.bpm.modules.gateway.vo.GatewayRouteVO>
	 **/
	List<GatewayRouteVO> getByBaceServiceId(Long backServiceId);

	/**
	 * @Description 根据网关id获取网关路由信息
	 * @Date 2019/11/26 16:08
	 * @param apiId,env
	 * @return java.util.List<com.dhcc.bpm.modules.gateway.vo.GatewayRouteVO>
	 **/
	GatewayRouteVO getGatewayByApiId(@Param("apiId") String apiId, @Param("env") String env);

	int updateBackServiceIdByApiId(@Param("gatewayRoute") GatewayRouteVO gatewayRoute);

	List<GatewayRouteVO> findByServerId(Long externalcallId);

	Integer queryMaxOrder(@Param("gatewayRoute") GatewayRoute gatewayRoute);

	List<GatewayRouteVO> queryOrder(@Param("gatewayRoute") GatewayRoute gatewayRoute);

	List<GatewayRoute> findOrderChild(@Param("gatewayRoute") GatewayRoute gatewayRoute);
}
